package MuleGUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.FlowLayout;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class GameOverGUI extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GameOverGUI frame = new GameOverGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public GameOverGUI() {
		setTitle("Game Over (game over GUI");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));
		
		JLabel lblGameOver = new JLabel("Game Over");
		lblGameOver.setHorizontalAlignment(SwingConstants.CENTER);
		contentPane.add(lblGameOver, BorderLayout.NORTH);
		
		JPanel playerPanel = new JPanel();
		contentPane.add(playerPanel, BorderLayout.WEST);
		playerPanel.setLayout(new BoxLayout(playerPanel, BoxLayout.Y_AXIS));
		
		JLabel lblPlayers = new JLabel("Players");
		playerPanel.add(lblPlayers);
		
		JLabel lblPlayer_1 = new JLabel("Player 1");
		playerPanel.add(lblPlayer_1);
		
		JLabel lblPlayer_2 = new JLabel("Player 2");
		playerPanel.add(lblPlayer_2);
		
		JLabel lblPlayer_3 = new JLabel("Player 3");
		playerPanel.add(lblPlayer_3);
		
		JLabel lblPlayer_4 = new JLabel("Player 4");
		playerPanel.add(lblPlayer_4);
		
		JPanel totalPanel = new JPanel();
		contentPane.add(totalPanel, BorderLayout.EAST);
		totalPanel.setLayout(new BoxLayout(totalPanel, BoxLayout.Y_AXIS));
		
		JLabel lblTotal = new JLabel("Total");
		totalPanel.add(lblTotal);
		
		JLabel lblPlayer1Total = new JLabel("\u2026.");
		totalPanel.add(lblPlayer1Total);
		
		JLabel lblPlayer2Total = new JLabel("\u2026.");
		totalPanel.add(lblPlayer2Total);
		
		JLabel lblPlayer3Total = new JLabel("\u2026.");
		totalPanel.add(lblPlayer3Total);
		
		JLabel lblPlayer4Total = new JLabel("\u2026.");
		totalPanel.add(lblPlayer4Total);
		
		JPanel bottomPanel = new JPanel();
		contentPane.add(bottomPanel, BorderLayout.SOUTH);
		
		JLabel lblPlayerWins = new JLabel("Player 1 Wins!");
		bottomPanel.add(lblPlayerWins);
		
		JButton btnNewButton = new JButton("Restart");
		btnNewButton.addMouseListener(new MouseAdapter() {
			public void mouseClicked(MouseEvent e) {
				setVisible(false);
				new StartGUI().setVisible(true);
			}
		});
		bottomPanel.add(btnNewButton);
		
		JPanel centerPanel = new JPanel();
		contentPane.add(centerPanel, BorderLayout.CENTER);
		centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.X_AXIS));
		
		JPanel landMoneyPanel = new JPanel();
		centerPanel.add(landMoneyPanel);
		landMoneyPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		
		JPanel moneyPanel = new JPanel();
		centerPanel.add(moneyPanel);
		moneyPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
	}
}
